# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Fabian Schoelzel <myfirstname.mylastname@googlemail.com>
# Contributor: funkyou <spamopfer@nickname.berlin.de>
# Contributor: tardo <tardo@nagi-fanboi.net>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgname=mlt
pkgver=7.16.0
pkgrel=1
pkgdesc='An open source multimedia framework'
arch=(x86_64)
url='https://www.mltframework.org'
license=(GPL)
depends=(libebur128)
optdepends=('sdl_image: SDL1 plugin'
            'sdl2: SDL2 plugin'
            'libsamplerate: libavresample plugin'
            'sox: SOX (Audio Swiss Army Knife) plugin'
            'ffmpeg: ffmpeg plugin'
            'vid.stab: video stabilize plugin'
            'qt5-svg: Qt5 plugins'
            'qt6-svg: Qt6 plugin' 'qt6-5compat: Qt6 plugin'
            'jack: JACK sound output plugin'
            'ladspa: LADSPA plugins'
            'libexif: auto rotate plugin'
            'frei0r-plugins: for additional effects'
            'movit: opengl plugin'
            'opencv: openCV plugin'
            'rubberband: audio pitch plugin'
            'gdk-pixbuf2: gdk plugin'
            'pango: gdk plugin'
            'rtaudio: rtaudio plugin'
            'python: python bindings')
makedepends=(cmake ladspa frei0r-plugins libdv sdl_image libsamplerate sox ffmpeg vid.stab qt5-svg qt6-svg qt6-5compat
             jack libexif python swig movit eigen opencv rubberband gdk-pixbuf2 pango rtaudio imagemagick)
source=(https://github.com/mltframework/mlt/releases/download/v$pkgver/mlt-$pkgver.tar.gz)
sha256sums=('c0975e06403d3df22be7d4b5d96d0608e0d16470299360d0a0ee5f41ba2b7a96')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DMOD_OPENCV=ON \
    -DMOD_GLAXNIMATE=ON \
    -DMOD_QT6=ON \
    -DSWIG_PYTHON=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
